<!--
 * @Author: your name
 * @Date: 2020-04-03 12:20:27
 * @LastEditTime: 2020-04-27 16:11:40
 * @LastEditors: Please set LastEditors
 * @Description: In User Settings Edit
 * @FilePath: \zhaoji\detail.html
 -->
<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8" />
  <meta content="yes" name="apple-mobile-web-app-capable" />
  <meta content="yes" name="apple-touch-fullscreen" />
  <meta content="telephone=no,email=no" name="format-detection" />
  <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
  <title>明细</title>
  <link rel="stylesheet" href="./css/detail.css" />
  <script src="./js/vue.js"></script>
  <script src="./js/flex.js"></script>
</head>
<body>
  <div id="app" v-cloak>
    <div id="main">
      <div v-if="lists.length" class="detail-box" v-for="(item, index) in lists" :key="index">
        <div class="info">
          <p class="desc">召集充值返利</p>
          <time class="time">{{ item.created_at }}</time>
        </div>
        <div class="diamond">+{{ item.award_diamond }}</div>
      </div>
      <p style="text-align: center; color:gray;" v-if="lists.length === 0">暂无明细</p>
    </div>
  </div>
</body>
<script src="./js/tool.js"></script>
<script>
  var app = new Vue({
    el: '#app',
    data: {
      baseUrl: '',
      lists: []
    },
    mounted() {
      this.init()
    },
    methods: {
      init() {
        let _this = this
        kk.ajaxGet("./config.json", {}, function(res) {
          let {devUrl, proUrl, localUrl, env} = res
          kk.env = env
          if(env === "dev") {
            _this.baseUrl = devUrl
          } else if(env === "production"){
            _this.baseUrl = proUrl
          } else if(env === "local") {
            _this.baseUrl = localUrl
          }

          _this.getDetails()
        })
      },
      getDetails(){
        let _this = this
        kk.get(_this.baseUrl + '/convene/recharge/details/' + kk.$_GET['user_id'], {}, function(res) {
          if(kk.env === 'production') {
            res = kk.parseBase64(res)
          }
          let { code, data } = res;
          if(code === 200){
            _this.lists = data
          }
        })
      }
    }
  });
</script>
</html>